package com.asset.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 处置记录
 * @author 11725
 */
@Data
@Table(name = "tab_asset_handle")
public class AssetHandle {
    /** 处置记录 id */
    @Id
    @KeySql(useGeneratedKeys = true)
    @Column(name = "handle_id")
    private Long id;

    @NotNull(message = "资产编号不得为空")
    /** 资产编号 */
    private Long assetId;

    /** 管理员编号 */
    private Long userId;

    /** 管理员部门编号 */
    private Long depaId;

    @NotNull(message = "处置类型不得为空")
    /** 处置类型：维修3/维护4/报废5/变卖6/转移7 */
    @Column(name = "handle_type")
    private Integer type;

    /** 审批状态：待审批/已批准/未批准 */
    @Column(name = "approval_state")
    private Integer status;

    /** 申请提交时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date applyTime;

    /** 审批时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date handleTime;
}
